<%--
  Created by IntelliJ IDEA.
  User: 杨璞
  Date: 2017/11/28
  Time: 17:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<html>
<head>
    <title>数字岔河综合管理平台</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name=”viewport” content=”width=device-width, initial-scale=1, maximum-scale=1″>
    <script type="text/javascript" src="/js/jquery/jquery-1.9.1.js"></script>
    <script src="../js/jquery/jquery.cookie.js"></script>
    <script src="../js/base/base.js"></script>
    <style>
        html,body{
            height:100%;
            width:100%;
        }
        body{
            margin:0px;
        }
        .content{
            /*min-width:1366px;*/
            height:100%;
            width:100%;
            background: url('/img/anquan/backjing.png') no-repeat;
            background-size:100% 100% ;
        }
        .header{
            width:100%;
            overflow: hidden;
        }
        .sky{
            float:left;
            margin:-5px 0px 0px 40px;
        }
        .headRight{
            float:right;
            margin:32px 40px 0px 0px;
        }
        .date{
            width:100%;
            text-align: center;
            color:red;
            font-weight: bold;
            margin-top: -77px;
        }
        .time{
            font-size:30px;
        }
        .mon{
            font-size:24px;
        }
        .date p{
            margin:0px;
        }
        .date{
            color:#db3535;
        }
        .date .mon{
            font-size: 24px;
        }
        .date .time{
            font-size:38px;
        }
        .title{
            text-align: center;
            margin-top:76px;
        }
        .section{
            width:860px;
            height:340px;
            margin: 50px auto 0px;
        }
        .section ul{
            width:696px;
            height:340px;
            overflow: hidden;
            float:left;
            list-style:none;
            margin:0px;
            padding:0px;
        }
        .section ul li{
            float:left;
            margin-right:10px;
        }
        .section ul li a{
            display: inline-block;
            width:100%;
            height:164px;
        }
        .work{
            float:right;
        }
        .work a{
            display: inline-block;
            width:100%;
            height:340px;
        }
        .wdfw{
            color:#db3535!important;
            font-weight: bold;
            position: absolute;
            right:-100px;
            top:64px;
        }
        .daywd{
            position: absolute;
            right:-66px;
            top:21px;
            color:#db3535!important;
        }
        @media screen and (min-width: 700px) and (max-width: 1100px) {
            .title{
                margin-top: 10px;
            }
            .section{
                margin-top: 20px;
            }
        }
    </style>
</head>
<body>
<div class="content">
    <div>
        <div class="header">
            <div class="sky" style="position: relative">
                <%--<img src="/img/Intelligent/weather.png" alt="">--%>
                    <img src="/img/weather/晴.png" class="weather" alt="">
                    <div class="daywd" style="color: #fff;font-size: 40px;font-weight: 600;height: 30px;padding-left: 47px; ">-2°</div>
                    <div class="wdfw" style="color: #b5c0d6;font-size: 14px;padding-left: 16px;margin-top: 2px;">晴-6℃~4°℃</div>
            </div>
            <div class="headRight">
                <a href=""><img src="/img/Intelligent/msg.png" alt="" style="margin-right:30px;"></a>
                <a href=""><img src= "/img/Intelligent/changeSkin.png" alt="" ></a>
            </div>
        </div>
        <div class="date" style="height: 80px;">
            <%--<p>--%>
                <%--<img src="/img/Intelligent/time.png" alt="">--%>
            <%--</p>--%>
            <%--<p class="time">11:10</p>--%>
            <%--<p class="mon">2017/11/29[星期三]</p>--%>
                <p class="time"></p>
                <p class="mon"></p>
        </div>
    </div>
    <div class="title">
        <%--<img src="/img/Intelligent/title.png" alt="">--%>
        <span style="color:red;font-size:40px;font-weight: bold;">数字岔河综合管理平台</span>
    </div>
    <div class="section">
        <ul class="list">
            <li type="01">
                <a href="javascript:;" id="center"><img src="/img/Intelligent/command.png" alt=""></a>
            </li>

            <li type="02" data-id="0260" class="qita">
                <a href="javascript:;"><img src="/img/Intelligent/cure.png" alt=""></a>
            </li>
            <li type="03" data-id="0349" class="qita">
                <a href="javascript:;"><img src="/img/Intelligent/environmental.png" alt=""></a>
            </li>
            <li  type="04" data-id="0404" class="qita">
                <a href="javascript:;"><img src="/img/Intelligent/party.png" alt=""></a>
            </li>

            <li type="05" data-id="0502" class="qita">
                <a href="javascript:;"><img src="/img/Intelligent/community.png" alt=""></a>
            </li>
            <li type="06" data-id="0601" class="qita">
                <a href="javascript:;"><img src="/img/Intelligent/bigDate.png" alt=""></a>
            </li>
            <li type="07" data-id="0701" class="qita">
                <a href="javascript:;"><img src="/img/Intelligent/wisdom.png" alt=""></a>
            </li>
            <li type="08" data-id="z030" class="qita">
                <a href="javascript:;"><img src="/img/Intelligent/sysManage.png" alt=""></a>
            </li>
        </ul>
        <div class="work" data-id="000">
            <a href="/main"><img src="/img/Intelligent/office.png" alt=""></a>
        </div>
    </div>
</div>
</body>
<script>
    <%--获取当前时间--%>

    setInterval(function(){
            var date=new Date();
            var month=date.getMonth()+1;
            var mydate=date.getDay();
            switch (mydate){
                case 0:
                    mydate='星期日';
                    break;
                case 1:
                    mydate='星期一';
                    break;
                case 2:
                    mydate='星期二';
                    break;
                case 3:
                    mydate='星期三';
                    break;
                case 4:
                    mydate='星期四';
                    break;
                case 5:
                    mydate='星期五';
                    break;
                case 6:
                    mydate='星期六';
                    break;
            }
            var x=date.getFullYear()+"/"+month+"/"+date.getDate();
            $('.mon').html(x+'['+mydate+']');

            var shi=date.getHours()<10?'0'+date.getHours():date.getHours()
            var fen= date.getMinutes()<10?'0'+date.getMinutes():date.getMinutes()
            $('.time').html(shi+':'+fen)
        },1000)
    $('#center').click(function(e){
        e.preventDefault()
        var id=$(this).parent().attr('type')
        var arr2=[];
        $.ajax({
            url: '/showMenu',
            type: 'get',
            dataType: 'json',
            success: function (obj) {
                var obj = obj.obj;
                for(var i=0;i<obj.length;i++){
                    arr2.push(obj[i].id)
                }
                console.log(id)
                if(arr2.indexOf(id)>=0){
//                    $.cookie('menuId',dataId , { expires: 7 , path: '/' });
                      window.open("../street/fullScreen");
                }else{
                    $.layerMsg({content:'您没有该权限',icon:6})
                }

            }
        })

    })




    $('.list .qita').click(function(){
        var i=$(this).index();
        var dataId=$('.list li').eq(i).attr('data-id');
        var id=$('.list li').eq(i).attr('type');
        var arr=[];
        $.ajax({
            url: '/showMenu',
            type: 'get',
            dataType: 'json',
            success: function (obj) {
                var obj = obj.obj;
                console.log(obj);
                for(var i=0;i<obj.length;i++){
                    arr.push(obj[i].id);
                }

                if(arr.indexOf(id)>=0){
                    $.cookie('menuId',dataId , { expires: 7 , path: '/' });
                    window.location.href='/main'
                }else{
                    $.layerMsg({content:'您没有该权限',icon:6})
                }

            }
        })


//        $('.list li').eq(i).find('a').attr('href','/main')
    })

    $('.work').click(function(){
        var dataId=$(this).attr('data-id');
        $.cookie('menuId',dataId , { expires: 7 , path: '/' });
        window.location.href='/main'
    })

    /*******************天气***********************************/
    $.ajax({
        type: "post",
        url: "/widget/getWidgetToDoWeather",
        data: {cityName:'邳州市'},
        success: function(res){
            var pmTwoPointFive = res.object[0].object.pmTwoPointFive;
            var tempertureOfDay = res.object[0].object.tempertureOfDay;
            var weather = res.object[0].object.weather;
            var tempertureNow = res.object[0].object.tempertureNow;
            var pmTwoPointFiveString = res.object[0].object.pmTwoPointFiveString;
            $('.daywd').html(tempertureNow+'°');
            $('.wdfw').html(weather+' '+tempertureOfDay);
            $('.pm').html(pmTwoPointFive+' '+pmTwoPointFiveString);
            if(weather == '阵雨'){
                var weather = '大雨';
            }else if(weather == '阵雪'){
                var weather = '大雪';
            }else if(weather == '雷阵雨伴有冰雹'){
                var weather = '雷阵雨';
            }else if(weather == '大暴雨'||weather == '特大暴雨'){
                var weather = '暴雨';
            }else if(weather == '阵雪'){
                var weather = '大雪';
            }else if(weather == '冻雨'){
                var weather = '大雨';
            }else if(weather == '沙尘暴'){
                var weather = '扬沙';
            }else if(weather == '小雨-中雨'){
                var weather = '中雨';
            }else if(weather == '中雨-大雨'){
                var weather = '大雨';
            }else if(weather == '大雨-暴雨'){
                var weather = '暴雨';
            }else if(weather == '暴雨-大暴雨'){
                var weather = '暴雨';
            }else if(weather == '大暴雨-特大暴雨'){
                var weather = '暴雨';
            }else if(weather == '小雪-中雪'){
                var weather = '中雪';
            }else if(weather == '中雪-大雪'){
                var weather = '大雪';
            }else if(weather == '大雪-暴雪'){
                var weather = '暴雪';
            }else if(weather == '浮尘'||weather == '强沙尘暴'){
                var weather = '扬沙';
            }else if(weather == '晴转多云'){
                var weather = '多云';
            }else{
                var weather = '多云';
            }
            $('.weather').attr('src','/img/weather/'+weather+'.png');
        }
    });



</script>
</html>